package com.example.demo.controller;

import com.example.demo.pojo.user;
import com.example.demo.service.User_serviceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/*查询接口*/

@Controller
public class find_all_controller {
    @Autowired
    User_serviceImpl service;
    @GetMapping("/tea")
    @ResponseBody
    public List<user> findTea(){
        List<user> allTea = service.findAllTea();
        System.out.println("返回成功");
        return allTea;
    }
    @GetMapping("/stu")
    @ResponseBody
    public List<user> findStu(){
        List<user> allStu = service.findAllStu();
        System.out.println("返回成功");
        return allStu;
    }
}
